package com.huawei.appmarket.service.store.awk.node;

import android.content.Context;
import android.graphics.Rect;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.huawei.appmarket.service.store.awk.card.PlaceholderCard;
import com.huawei.appmarket.service.store.awk.card.SafeAppCard;
import com.huawei.appmarket.service.store.awk.card.TopadAppCard;
import o.cdr;
import o.cgz;
import o.chy;
import o.cih;
import o.djs;
import o.djs.c;
import o.eib;
import o.ewm.h;
import o.ewm.j;

public class TopadAppNode extends cdr {
    public TopadAppNode(Context context) {
        super(context, eib.ॱˎ());
    }

    public int ˏ() {
        return eib.ॱᐝ();
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
        layoutParams.weight = 1.0f;
        int ˏ = ˏ();
        LayoutInflater from = LayoutInflater.from(this.ॱ);
        djs o_djs = new djs(ˏ, eib.ॱ(), eib.ˎ());
        c ˊ = o_djs.ˊ();
        while (true) {
            Rect ˎ = ˊ.ˎ();
            if (ˎ == null) {
                return true;
            }
            cih topadAppCard = new TopadAppCard(this.ॱ);
            View view = (ViewGroup) from.inflate(h.ˊʿ, null);
            topadAppCard.ˏ(view);
            View inflate = from.inflate(h.ㆍ, null);
            o_djs.ˋ(inflate, j.ʻᐝ, ˎ);
            cgz ˎ2 = ˎ(inflate);
            View inflate2 = from.inflate(h.ﾟॱ, null);
            PlaceholderCard ˋ = ˋ(inflate);
            topadAppCard.ˊ(ˎ2);
            topadAppCard.ॱ(ˋ);
            topadAppCard.ˋ(ˎ2);
            view.addView(inflate);
            view.addView(inflate2);
            ˊ(topadAppCard);
            viewGroup.addView(view, layoutParams);
        }
    }

    protected SafeAppCard ˎ(View view) {
        SafeAppCard safeAppCard = new SafeAppCard(this.ॱ);
        safeAppCard.ˏ(view);
        return safeAppCard;
    }

    protected PlaceholderCard ˋ(View view) {
        PlaceholderCard placeholderCard = new PlaceholderCard(this.ॱ);
        placeholderCard.ˏ(view);
        return placeholderCard;
    }

    public void ˋ(chy o_chy) {
        TopadAppCard topadAppCard = (TopadAppCard) ˊ(0);
        if (topadAppCard != null) {
            topadAppCard.ˋ().ॱ(o_chy);
        }
    }
}
